<template>
  <div class="main ad-manage-edit">
    <section>
      <div class="content-bottom">
        <el-table :data="list" border stripe>
          <el-table-column type=index label="序号" width="60" align="center">
          </el-table-column>
          <el-table-column prop="startTime" label="红包雨活动开始时间"></el-table-column>
          <el-table-column prop="hongbaoRainRuleList[0].totalAmount" label="设置金额"></el-table-column>
          <el-table-column prop="usedTotalAmount" label="实发金额"></el-table-column>
          <el-table-column prop="participants" label="参与人数"></el-table-column>
          <el-table-column prop="singleAmount" label="单个红包金额"></el-table-column>
        </el-table>
        <el-pagination @current-change="currentChange" @size-change="changeSize" :current-page="form.pageIndex" :page-size="form.pageSize" layout="total, prev, pager, next, jumper" :total="total" background>
        </el-pagination>

      </div>
    </section>
  </div>
</template>

<script>
  import { getPacketRainList, packetAction } from '@/api/searchMsg'

  export default {
        name: "doneRecord",
      data() {
          return {
            form: {
              startTime: '',
              state: 3,
              pageIndex: 1,
              pageSize: 20,
            },
            list: [],
            total: 0,
          }
      },
    created() {
      this.getList()
    },
      methods: {
        async getList() {
          this.form.startTime = !this.form.startTime ? '' : this.form.startTime;
          const res = await getPacketRainList(this.form);
          if (res.status === 200) {
            this.list = res.data;
            this.total = res.totalCount;
          }
        },
        currentChange(val) {
          this.form.pageIndex = val;
          this.getList();
        },
        changeSize(size) {
          this.form.pageSize = size;
          this.getList()
        }

      }
    }
</script>

<style scoped>

</style>
